Skip to content

Upload the unit test coverage to Codacy - #165

Merged
PDowney merged 3 commits into
mainfrom
codacy-coverage
Nov 24, 2026
Merged

PDowney merged 3 commits into
mainfrom
codacy-coverage

Conversation

@PDowney

@PDowney PDowney commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Send the unit test coverage to Codacy.

Why

The unit-coverage job wrote clover.xml but never uploaded it, so Codacy's coverage for this repository stopped. No workflow ever uploaded it.

What changes

A new step in the unit-coverage job, after the line-coverage check:

  • Pinned reporter: downloads Codacy's coverage reporter 14.1.3 from its GitHub release and checks it against a SHA-512 written in the workflow. Codacy's GitHub Action is not used: its last release was in January 2022, and it fetches the reporter script from a master branch on every run.
  • Upload: sends clover.xml for the commit Codacy analyzes, which on a pull request is the head commit, not GitHub's merge commit. It reads the repository token from the CODACY_PROJECT_TOKEN secret.
  • When it runs: on pushes and on pull requests from branches in this repository. Dependabot's and forks' pull requests get no secrets, so they skip the upload.
  • Failures: a failed upload fails the job on pushes, and the job's issue names the upload_coverage stage; the issue template explains what that stage means. On a pull request, the failure is reported without blocking the merge.

Dependabot cannot update the reporter. A weekly workflow in EngineScript/EngineScript checks the pinned version in all five repositories and files an issue when a newer release is out.

Verification

  • actionlint, yamllint, the workflow schema, checkov, markdownlint, ShellCheck on the new step's script, and gitleaks pass. zizmor's default level reports nothing new.
  • This pull request's own run is the first upload. Codacy should show its head commit's coverage.

🤖 Generated with Claude Code

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant